#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>

#define CMD_TEST0 _IO('a',0)
#define CMD_TEST1 _IO('a',1)
//#define cMD_TEST2 _IOW('c',2,int)
//#define CMD_TEST3 _IOR('d',3,int)

int main(int argc ,char *argv[]){
    int fd;
    fd = open("/dev/my_misc_ioctl",O_RDWR);
    if(fd < 0)
    {
        printf("open error\n");
        return fd;
    }
    while(1){
        ioctl(fd,CMD_TEST0);
        sleep(2);
        ioctl(fd,CMD_TEST1);
        sleep(2);
    }
    return 0;
}
